<%@ page language="java" import="java.util.*" pageEncoding="utf-8"
	isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改系统角色信息</title>

<script type="text/javascript"
	src="<%=request.getContextPath()%>/easyui/jquery.min.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/easyui/locale/easyui-lang-zh_CN.js"></script>
<link
	href="<%=request.getContextPath()%>/easyui/themes/default/easyui.css"
	rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/easyui/themes/icon.css"
	rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/style.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/jquery-2.1.4.min.js"></script>
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/css/jPages.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/umeditor/themes/default/css/umeditor.css">
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/css/animate.css">
<script src="<%=request.getContextPath()%>/js/jquery-1.8.2.min.js"></script>
<script src="<%=request.getContextPath()%>/js/jPages.js"></script>
<!--ueditor插件js-->
<script type="text/javascript" src="<%=request.getContextPath()%>/umeditor/third-party/template.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/umeditor/umeditor.config.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/umeditor/umeditor.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/umeditor/lang/zh-cn/zh-cn.js"></script>
<style type="">
dl, dt, dd, span {
	display: block;
}

.forminfo li i {
	padding-left: 3px;
}
input{
   border: solid 1px #d7a372;
}
</style>
</head>

<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><ema href="javascript:void">首页</em></li>
			<li><ema href="javascript:void">内容管理</em></li>
			<li><ema href="javascript:void">消息管理</em></li>
			<li><ema href="javascript:void">消息详情</em></li>
		</ul>
	</div>
	</br>
	</br>
	<c:forEach items="${lists}" var="data">
	<ul class="forminfo">
		<li>消息状态：<select name="type" id="type">
				<option value="1">${data.status}</option>
		</select></li>
		<li>消息标题：    &nbsp;&nbsp;${data.title}</li>
		<input type="hidden" id="recevicer1" value="${data.recevicer}"/>
		<li>推送用户：   &nbsp;&nbsp;${data.scope}
		  <!--  <div class="col-sm-3" style="width: 100%">
								<table class="table">
									<tr>
										<td style="width: 180px;font-weight: bold;"><input id="start_the_boot" type="checkbox" name="actionId"
											value="1"><i>全部用户</i></td>
										<td style="width: 150px;"><input class="start_the_boot" type="checkbox"
												name="actionId" value="11"><i>老师</i></td>
										<td style="width: 150px;"><input class="start_the_boot" type="checkbox"
												name="actionId" value="12"><i>家长</i></td>
										<td style="width: 150px;"><input class="start_the_boot" type="checkbox"
												name="actionId" value="13"><i>学生</i></td>
									</tr>
								</table>
		</div> -->
		</li>
		<li>推送时间： &nbsp;&nbsp;${data.push_time}
		</li>
		<li>推送内容
		 <div style="margin-bottom:20px;" class="col-sm-10">
			<script type="text/plain" id="myEditor" class="form-control" style="width:100%;height:240px;"> ${data.content}</script>
		  
		</div>	
		</li>
	</ul>
	<div style="margin-left: 400px;">
		
<!-- 		&nbsp;<input name="" type="button" class="cancel" value="返回" /> -->
	</c:forEach>
	<div class="tip">
		<div class="tiptop">
			<span>提示信息</span>
		</div>
		<div class="tipinfo">
			<span><img
				src="<%=request.getContextPath()%>/images/ticon.png" /></span>
			<div class="tipright">
				<p>添加成功!</p>
				<cite>点击确定返回消息列表 。</cite>
			</div>
		</div>
		<div class="tipbtn">
			<input name="" type="button" class="sure" value="确定" />&nbsp;<input
				name="" type="button" class="cancel" value="取消" />
		</div>
	</div>
	<script type="text/javascript">
	//实例化编辑器
    var um = UM.getEditor('myEditor');
    //失去焦点
    um.addListener('blur',function(){
    	//判断是否有内容
        if(UM.getEditor('myEditor').hasContents()){
        	$("#infomationContent").val(UM.getEditor('myEditor').getContent());
        }
    });
    //获得焦点
    um.addListener('focus',function(){
        
    });
    	$(function(){
    		$(".tijiao").click(function(){
    			var msgtitle = $("input[name=msgtitle]").val();
    			var type = $('#type').val();
    			if(type == null || type == ""  ){
    				return;
    			}
    			if(msgtitle == null || msgtitle == ""  ){
    				alert("消息标题不能为空");
    				return;
    			}
    			var array=new Array();
				$('input[type=checkbox]:checked').each(function(){ 
					array.push($(this).val()); 
					}); 
				var recevicer= array.join(",");
				if(recevicer==""){
					alert("请至少选中一个用户角色");
					return ;
				}
				var msgcontent= UM.getEditor('myEditor');
				var push_the_time = $('#push_the_time').val();
    		})
    		
	   		$(".sure").click(function(){
	   			window.location.href="/htx-backer/messageList";
	   		});
	
	   		$(".cancel").click(function(){
	   			window.location.href="/htx-backer/messageList";
	   		});
	   		$("#start_the_boot").click(function(){
				 if($(this).is(':checked')){
					$(".start_the_boot").each(function(){
						$(this).prop("checked",true);
					}) 
				}else{
					$(".start_the_boot").each(function(){
						$(this).prop("checked",false);
					})
				} 
			});
	   		var recevicer=$('#recevicer1').val();
	    	if(recevicer!=""){
					 console.log("roleId:"+roleId);
		   	     	 var radioAll  = $("input[name='actionId']");  
		   	         var strs= new Array(); //定义一数组     
		   	         strs=recevicer.split(","); //字符分割    
		   	         console.log(strs)
		   	          for (var int = 0; int < strs.length; int++) {						   
		   	           var authId =$.trim(strs[int]);	            
		   	           	for(var a=0 ; a<radioAll.length ;a++){
		   					    var radoiVal = radioAll.eq(a).val();  
		   				    		    if(radoiVal == authId) {
		   				    		        radioAll.get(a).checked = true;
		   				    		    }
		   				    		} 
		   				}
				}
    	})
    	
    </script>
</body>
</html>
